<template>
  <div class="c-detail">
    <ul v-if="mold === 0">
      <li class="item" v-for="(v, i) in detail" :key="i">
        <div class="name" v-if="regulation">{{type[v.profitType-1]}}</div>
        <div class="name" v-if="!regulation">购买商品</div>
        <div class="time">{{v.createTime}}</div>
        <div class="price" v-if="regulation">+{{v.profitCount}}</div>
        <div class="price" v-if="!regulation">-{{v.profitCount}}</div>
      </li>
    </ul>
    <ul v-else>
      <li class="item" v-for="(v, i) in detail" :key="i">
        <div class="name" v-if="regulation">{{type[v.integralType-1]}}</div>
        <div class="name" v-if="!regulation">兑换商品</div>
        <div class="time">{{v.createTime}}</div>
        <div class="price" v-if="regulation">+{{v.integralCount}}</div>
        <div class="price" v-if="!regulation">-{{v.integralCount}}</div>
      </li>
    </ul>
  </div>
</template>

<script>
  export default {
    name: 'detail',
    props: {
      detail: {
        type: Array,
      },
      type: {
        type: Array,
      },
      regulation: {
        type: Boolean,
      },
      mold: {
        type: Number,
      }
    },
  }
</script>
